package com.jin.dto;

import com.jin.dto.validators.PasswordEqual;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

//接收前端发送过来的数据
//我们称为数据传输对象
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@PasswordEqual(min = 3,max = 6,message = "请输入相同的密码，并遵守密码规范")
public class PersonDTO {
    @Length(min = 2,max = 10,message = "名字不规范")
    private String name;
    private Integer age;
//    @Valid//验证关联字段的注解
//    private SchoolDTO schoolDTO;

    private String password1;
    private String password2;

}
